Skip to content

Gateway: enforce caller authority and opaque app documents - #197

Merged
andersalm merged 7 commits into
developfrom
fix/167-frontdoor-origin
Oct 2, 2026
Merged

andersalm merged 7 commits into
developfrom
fix/167-frontdoor-origin

Conversation

@andersalm

@andersalm andersalm commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The gateway checks its configured Host, request origin and caller authority before reading private bodies. Runtime keeps Carrier bootstrap private unless the host enables its existing public publisher projection. Assistant launches are refused on Home routes. App and shell documents have opaque origins and gateway-only connections; Documents escapes hostile Markdown fields.

Anonymous passkey begin returns an empty credential list. Challenge pools and real-peer begin limits remain bounded. Authorized step-up selects only its original credential. Older security keys recover through a local operator hint: the CLI reads existing metadata, Home selects one ID in the browser, and the existing gateway verifies the proof. The same principal, root and role are preserved. Home clears the hint after each attempt, cancel and page exit.

Direct Chat gives a same-window Open Home link and starts neither WASM nor private API requests before Home launch. Signed Chat retains its existing startup. The historical CHAT-02 guest-admission prerequisite remains open; this change proves direct-entry recovery.

Validation:

  • 2264 server library cases passed locally. Seven native-provider cases lacked local fixture binaries; final Linux CI supplies them and passes the full workspace, both actual-browser journeys and all eight required checks. Run 36950212069 is green on candidate 678ae6b1.
  • Five metadata-reader tests and the identity privacy regression pass. Catalog revalidation, gateway shutdown and authorized step-up pass with the configured front-door authority.
  • Both actual gateway browser fixtures pass: content/CID/app isolation, foreign localhost and DNS-rebinding refusal, Chat recovery, nonresident-key recovery, preserved account authority, and invalid, replayed, wrong-RP and revoked proof refusal.
  • Home recovery/switch smokes, Chat startup/layout smokes, hostile Markdown cases, Clippy, formatting and entropy gates pass. Current develop was integrated with a normal merge.
  • The initial boundary diff passed two independent source review rounds. Focused corrections received direct source review and the listed regression proof. The PR is ready with green CI and irzhywau requested for the final candidate.

Refs #167 and the merged scope from #185. Depends on #188; its candidate acfe57f remains an ancestor. Target: develop. Source and fixture proof is recorded here; installed product and manual UX claims remain outside this evidence. Human approval and integrated dependencies gate merge.

@andersalm
andersalm marked this pull request as ready for review October 2, 2026 02:05
@andersalm
andersalm requested a review from irzhywau October 2, 2026 02:05
@andersalm
andersalm changed the base branch from develop to fix/168-content-sandbox October 2, 2026 03:22
@andersalm

Copy link
Copy Markdown
Contributor Author

Review note: this PR is now stacked on #188, so the diff shows only #167's changes; GitHub moves it back to develop when #188 merges.

About 7,000 of the changed lines are inline scripts moved unchanged into files, so the app CSP can use script-src 'self': documents/browser/index.html to documents.js (2,260 of 2,280 lines identical; the rest is the Markdown escaping fix), inbox/browser/index.html to inbox.js (all 841 identical) and archive-manager/browser/index.html to archive-manager.js (all 612 identical). git diff --color-moved=dimmed-zebra shows only the real changes.

@andersalm

Copy link
Copy Markdown
Contributor Author

Independent adversarial review (Claude Opus, run by the operator for Anders, 2 October; different model family from the author).
VERDICT: PASS (own commits on top of #188). Admission runs before body reads; Host and Origin rules, launch-token-only Carrier bootstrap, credential IDs no longer returned, app documents sandboxed including 304s, Markdown fence language restricted.
Non-blocking: the public list allows every path outside /api/ and /.well-known/ rather than naming them; the sign-in rate limit counts per socket IP, so behind a reverse proxy (the seed) all users share one budget (matters for #174 before reopening); documents get no CSP if Host is missing (unreachable today).

@andersalm
andersalm changed the base branch from fix/168-content-sandbox to develop October 2, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant